#pragma once

#include "Framework/CommonHead.h"
#include "Widgets/Widget.h"
#include "WidgetAttribute.h"
#include "RectangleWidget.m.h"


RCLASS()
class WHENGINE_API RRectangleWidget: public RWidget
{
    ROBJECT
public:    

    //if true, the rectangle will be filled with FillColor
    RFIELD()
    TWidgetAttribute<bool> Fill=true;

    RFIELD()
    TWidgetAttribute<SColor> FillColor=SColor(1,1,1,1);
    
    //the size of the border
    RFIELD()
    TWidgetAttribute<float> BorderSize=0;

    RFIELD()
    TWidgetAttribute<SColor> BorderColor=SColor(1,1,1,1);

    //the radius of the rectangle
    //if radius must > 0.5*Min(Width,Height), will be treat as 0.5*Min(Width,Height)
    //if radius < 0, will be treat as  0
    RFIELD()
    TWidgetAttribute<float> Radius=0;


    virtual void PaintSelf(uint16_t& InZOrder,const SRect& InClipArea) override;


};